#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
using namespace std;

class solution {
public:
	long long my_sqrt(long long n){
		long long x = sqrt(n);
		long long x1 = x * x, x2 = (x + 1) * (x + 1);
		return  x-x1 < x2-x ? x1 : x2;
	}
unordered_map<int, int> hash;
	int group(int n, int t) {
		
		int hmax = 0;
		vector<int> nums(n);
		for (int i = 0; i < n; ++i) {
			int x;
			cin >> x;
			hmax=(hmax,++hash[x]);
		}
		int left = 1, right = hmax;
		int kinds = hash.size();
		if (kinds > t) return -1;
		else {
			while (left < right) {
				int mid = (left + right) >> 1;
				if (check(mid) > t) left = mid + 1;
				else right = mid;
			}
		}
		return left;

		/*for(int i=1;i<=hmax;++i){
			int ans = 0;
			for (auto &[k,v]:hash) {
				ans += v/i + (v%i == 0 ? 0 : 1);
			}
			if (ans <= t) return i;
		}*/
		return -1;
	}

	int check(int n){
		int g = 0;
		for (auto& [k, v] : hash)
		{
			g += v / n + (v % n == 0 ? 0 : 1);
		}
		return g;
	}
};

int main()
{
	solution s;
	cout << s.group(5,3);
}